<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>档案首页</title>

<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap.min.js"></script>
<script type="text/javascript" src="libs/jquery.backstretch.min.js"></script>
<script type="text/javascript" src="libs/dateFormat.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<a class="navbar-brand" href="#">用户 _<span id="nickname"></span></a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	      <ul class="nav navbar-nav">
	        <li class="active"><a href="#">首页 <span class="sr-only">(current)</span></a></li>
	        <li><a href="#">Link2</a></li>
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">档案管理 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="archiveadd.html">添加档案</a></li>
	            <li><a href="#">删除档案 </a></li>
	            <li role="separator" class="divider"></li>
	            <li><a href="archivequery.html">查看档案</a></li>
	            <li role="separator" class="divider"></li>
	            <li><a href="#">One more separated link</a></li>
	          </ul>
	        </li>
	      </ul>
	      
	      <form class="navbar-form navbar-left" role="search">
	        <div class="form-group">
	          <input type="text" class="form-control" placeholder="档案号或者ID" id="arc_id">
	        <button type="submit" class="btn btn-default" id="hpbut">查询</button>
	        </div>
	      </form>
	      
	      <ul class="nav navbar-nav navbar-right">
	        <li><a href="#">Link3</a></li>
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户操作 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="changenn.html">更换用户名</a></li>
	            <li role="separator" class="divider"></li>
	            <li><button type="button" class="btn btn-link" id="quit">用户退出</button></li>
	          </ul>
	        </li>
	      </ul>
		</div><!-- /.navbar-collapse -->
	</div><!-- /.container-fluid -->
</nav>
<div class="container-fluid">
	<div class="row">
		<div class="col-lg-3">
		  	<div class="panel panel-Default">
			  	<div class="panel-heading"><label style="color: black">查看某一时间段的档案添加数</label></div>  	
				  	<div>
					  	<label style="color: black">开始时间</label><input type="date" id="date1"><br>
					  	<label style="color: black">结束时间</label><input type="date" id="date2">
					  	<input type="button" id="querytime" value="搜索" class="btn" >
			  		</div>	
			  	<div class="panel-body" id="text"></div>
		  	</div>
		</div>
	</div>
</div>

<script type="text/javascript">
$.backstretch("picture/4.jpg")
</script>
<script type="text/javascript">
$(function(){
	$('#hpbut').click(function(){
		$.getJSON('queryOne.action',{
			archive_id : $('#arc_id').val(),
		},function(res){
			console.log(res);
			if(res=='err'){alert('档案号或身份号错误');}
			else{
				window.location.href='archiveif.html?id='+res;
			}
			/* $('#id').text(res.id);
			$('#danganhao').text(res.archive_id);
			$('#identity').text(res.identity);
			$('#name').text(res.name); */
		});
	});
	$.getJSON('querynn.action',function(res){
		console.log(res);
		$('#nickname').text(res.nickname);
	});
	var d2 =new Date();
	$('#date2').val(d2.format('yyyy-MM-dd'));
	var d1 =new Date();
	$('#date1').val(d1.format('yyyy-MM-01'));
	$('#querytime').click(function() {
		$.post('querytime.action',{
			date2 : $('#date2').val(),
			date1 : $('#date1').val()
		},function(res){
			$('#text').text(res.counter);
			
			
			
		});
	});
	$('#quit').click(function(){
		$.post('quit.action',{
		},function(res){
			if("quit"==res){window.location.href='login.html';}
		});
	});
});

</script>

</body>
</html>